<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="sec"
	uri="http://www.springframework.org/security/tags"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>欢迎您</title>

<spring:url value="/resources/css/main.css" var="mainCss" />
<spring:url value="/resources/js/jquery-1.12.3.min.js" var="jQuery" />

<spring:url value="/resources/js/layer-v2.2/layer/layer.js" var="layer" />
<spring:url value="/resources/js/laydate-v1.1/laydate/laydate.js"
	var="laydate" />
<spring:url value="/resources/js/laytpl-v1.1/laytpl/laytpl.js"
	var="laytpl" />
<spring:url value="/resources/js/laypage-v1.3/laypage/laypage.js"
	var="laypage" />


<spring:url value="/resources/images/1.png" var="img1" />
<spring:url value="/resources/images/2.png" var="img2" />
<spring:url value="/resources/images/welcome.png" var="welcome" />

<script type="text/javascript" src="${jQuery}"></script>
<script type="text/javascript" src="${layer}"></script>
<script type="text/javascript" src="${laydate}"></script>
<script type="text/javascript" src="${laytpl}"></script>
<script type="text/javascript" src="${laypage}"></script>

<link href="${mainCss}" rel="stylesheet" />

<style type="text/css">
.ore_left_3 li {
	cursor: pointer;
}

.ore_right_3_left {
	cursor: pointer;
}

.button {
	cursor: pointer;
}

.form {
	padding-top: 50px;
}

.form-row {
	height: 40px;
}

.form-row label {
	float: left;
	width: 80px;
}

.form-row .form-control {
	float: left;
	width: 200px;
}

</style>

<script type="text/javascript">
	(function($) {

		$(function() {

			//加载扩展模块
			layer.config({
				extend : 'extend/layer.ext.js'
			});

			$("#logoutButton").click(function() {

				//退出确认
				layer.confirm('您确认要退出吗?', {
					btn : [ '确认', '取消' ]
				//按钮
				}, function() {

					$("#logoutForm").submit();

				}, function() {
					//取消
				});

			});

		});

	})(jQuery);
</script>


<script type="text/javascript">
	var loadModule = function(url) {
		$("#mainContainer").load(url);
	}
</script>

</head>
<body>

	<div style="display: none;">
		<c:url var="logoutUrl" value="/logout" />
		<form id="logoutForm" action="${logoutUrl}" method="post">
			<input type="hidden" name="${_csrf.parameterName}"
				value="${_csrf.token}" />
		</form>
	</div>


	<div class="ore">
		<div class="ore_left">
			<div class="ore_left_1">
				<img src="${img1}">
			</div>
			<div class="ore_left_2">
				<h3>大众矿评</h3>
			</div>
			<div class="ore_left_3">
				<ul>
					<li>${title}</li>
					<li>矿权管理</li>
					<li>评论管理</li>
					<li>订单管理</li>
					<li onclick="loadModule('usermanagement');">用户管理</li>
				    <li onclick="loadModule('minecategory');">分类管理</li>
				    <li onclick="loadModule('mine');">矿产管理</li>
					<li>企业管理</li>
					<li>员工管理</li>
					<li>反馈信息</li>
					<li>系统设置</li>
				</ul>
			</div>
		</div>
		<div class="ore_right">
			<div class="ore_right_1">
				<span> <img src="${img2}" /> <c:url value="/login?logout"
						var="logoutUrl" /> <c:if
						test="${pageContext.request.userPrincipal.name != null}">
		                                          欢迎您 : ${pageContext.request.userPrincipal.name} | 
		               <a id="logoutButton" style="color: white;" href="#">退出</a>
					</c:if>
				</span>
			</div>
			<div id="mainContainer">
				<img width="780" height="698" alt="welcome" src="${welcome}">
			</div>
		</div>
		<div class="clear"></div>
	</div>
</body>
</html>